<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
        <style>
            .fa {
                width: 200px;
                height: 200px;
                background-color: red;
            }
            .son {
                width: 50px;
                height: 50px;
                background-color: aqua;
            }
        </style>
    </head>
    <body>
        <div class="fa">
            <div class="son"></div>
        </div>
        <script>
            let fa = document.querySelector(".fa");
            let son = document.querySelector(".son");
            fa.addEventListener("click", function (event) {
                console.log("我被点击了");
            });
            son.addEventListener("click", function (event) {
                event.stopPropagation();//阻止冒泡事件，执行后其他冒泡事件停止执行；
                console.log("我被点击了");
            });
        </script>
    </body>
</html>
